package com.hbplat.shardingsphere.serialnumber.provider.service.seq;

import com.hbplat.shardingsphere.serialnumber.provider.dao.seq.SequenceWorkMapper;
import com.hbplat.shardingsphere.util.StringUtil;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 　　* @description: TODO
 * 　　* @param
 * 　　* @return
 * 　　* @throws
 * 　　* @author 陈宇
 * 　　* @date $ $
 *
 */

@Service(version = "1.0.0",interfaceClass = ISequenceService.class,timeout = 999999999,group = "bus")
@Component
public class SequenceServiceImpl implements ISequenceService {

    @Autowired
    private SequenceWorkMapper sequenceWorkMapper;

    /**
     * 查询序列号
     *
     * @param tableName
     * @return
     */
    @Override
    public Long selectSeq(String tableName) {
        if(StringUtil.isEmpty(tableName)){
            return null;
        }
        return sequenceWorkMapper.selectSeq(tableName);
    }
}
